package com.shushan.pages;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.shushan.base.NavigationLoseActivity;
import com.shushan.shushanbao.BabyApplication;
import com.shushan.shushanbao.R;
import com.shushan.util.UmengEventUtil;

/**
 * @ClassName: OpenVIPsuccessActivity
 * @Desciption: //开通VIP成功后跳转的页面
 * @author: zhangshihao
 * @date: 2018-05-22
 */
public class OpenVIPsuccessActivity extends NavigationLoseActivity implements View.OnClickListener{

    private Button btnUseGuide;
    private Button btnUseNow;
    private static final String OPEN_VIP_SUCESS = "OpenVipSucess";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_open_vip_success);
        setTitle("开通VIP");

        initView();

        BabyApplication.getInstance().setVip(true);
    }

    @Override
    protected void onResume() {
        super.onResume();

        UmengEventUtil.onPageStart(OPEN_VIP_SUCESS);
    }

    @Override
    protected void onPause() {
        super.onPause();

        UmengEventUtil.onPageEnd(OPEN_VIP_SUCESS);
    }

    private void initView(){
        btnUseGuide = findViewById(R.id.btn_use_guide);
        btnUseGuide.setOnClickListener(this);
        btnUseNow = findViewById(R.id.btn_use_now);
        btnUseNow.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.btn_use_guide:
                startActivity(SubscriptionStepsActivity.class);
                break;
            case R.id.btn_use_now:
                onBackAction();
                break;
        }
    }

}
